#ifndef __CLOCK_SOURCE__
#define __CLOCK_SOURCE__

class ClockSource;

class ClockObserver
{
public:
  /* Called at the beginning of the clock cycle */
  virtual void clock_tick () = 0;

private:
  friend class ClockSource;

  ClockObserver* _next;
};

class ClockSource
{
public:
  ClockSource ();

  void attach (ClockObserver& observer);
  void detach (ClockObserver& observer);

  void tick ();

private:
  ClockObserver* _observers;
};

#endif /* __CLOCK_SOURCE__ */
